home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / examples / misc / wexmast / worlddemo.pro < prev    next >
Text File  |  1997-07-08  |  15KB  |  452 lines

  1. ; $Id: worlddemo.pro,v 1.7 1997/01/15 04:29:15 ali Exp $
  2. ;
  3. ; Copyright (c) 1993-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. pro world_demo_color        ;Load color table suitable for elev data.
  7. common colors, r_orig, g_orig, b_orig, r_curr, g_curr, b_curr
  8.  
  9. ; Define interpolation points:  (elevation in meters, r, g, b)
  10. ; be sure elevation of 1st element is -5000 (data value 0), and last is
  11. ; 5240 (data value 256).
  12. c = fltarr(256, 3)
  13. p = [    [ -5000, 64, 64, 64], $        ;Dark Gray at 0
  14.     [ -4900, 0, 0, 128], $        ;Dim blue
  15.     [ -1500, 0, 0, 255], $        ;Bright blue
  16.     [ -40, 192, 192, 255], $
  17.     [ 0, 64, 192, 64], $        ;Med green
  18.     [ 250, 150, 150, 75], $        ;Dim Yellow
  19.     [ 1000, 200, 200, 100], $    ;Brighter yellow
  20.     [ 4000, 255, 255, 255], $    ;White
  21.     [ 5240, 255, 255, 255]]        ;To white
  22.  
  23. n = n_elements(p)/4
  24. for i=0,n-2 do begin        ;Intervals
  25.     s0 = (p[0,i]+5000) / 40    ;Color index
  26.     s1 = (p[0,i+1]+5000) / 40
  27.     m = s1 - s0
  28.     for j=0,2 do begin    ;Each color
  29.         s = float(p[j+1,i+1] - p[j+1,i]) / m
  30.         c[s0, j] = findgen(m) * s + p[j+1,i]
  31.         endfor
  32.     endfor
  33. r_orig = byte(c[*,0])
  34. g_orig = byte(c[*,1])
  35. b_orig = byte(c[*,2])
  36. r_curr = r_orig
  37. g_curr = g_orig
  38. b_curr = b_orig
  39. tvlct,r_orig, g_orig, b_orig
  40. end
  41.  
  42. PRO WORLDDEMO_EVENT, EVENT
  43. ;THIS IS THE WORLDROT EVENT HANDLER
  44.  
  45. ;COMMON BLOCK
  46. ;
  47.  
  48. COMMON world_block,projection,minlon,maxlon,minlat,maxlat,viewlat,width,$
  49.                    height,numframes,cna,dne,theproj,base,names,help,$
  50.            rotangle,message,adjust,$
  51.            drawcon,nocon,drawgrid, nogrid, im,$
  52.            bilinear,nointerp,con,grid,bilin, imsize
  53.  
  54. WIDGET_CONTROL, event.id, GET_UVALUE = eventval 
  55.  
  56. ; This IF THEN ELSE handles clicking on the exclusive menu of projections.
  57. ; The variable 'projection' was set with the 'buttons' keyword when the 
  58. ; exclusive menu of projections was created.
  59. ; The WHERE expression sets the value of 'projflag' to 1 if one of the 
  60. ; exclusive buttons is clicked on.  The variable 'projselection' will also
  61. ; hold the index of the button touched.
  62.  
  63. IF eventval EQ 'THEMENU' THEN BEGIN
  64.  
  65.     projselection = WHERE(projection EQ event.value, i)
  66.  
  67.     IF i NE 0 THEN theproj = projselection[0]
  68.     RETURN
  69. ENDIF
  70.  
  71. ;If something other than a exclusive button has been touched, manage the event
  72. ;with this CASE statement.
  73.  
  74. CASE eventval OF
  75.     "CREATE":BEGIN
  76.  
  77.         ;If Xinteranimate is already going, DON'T DO THIS:
  78.         IF (XREGISTERED("XInterAnimate") NE 0) THEN RETURN
  79.  
  80.         ;If the Create New Animation Button is pressed, 
  81.         ;read the values of all of the widgets from the tool.
  82.         ;Projection number is already in THEPROJ.
  83.  
  84.         ;Read the Info about Image fields:
  85.         lon1 = -180
  86.                 lon2 = 180
  87.                 lat1 = -90
  88.                 lat2 = 90
  89.  
  90.         ;Read the Latitude to be Centered slider:
  91.                 WIDGET_CONTROL, viewlat, GET_VALUE   = vlat
  92.     
  93.         ;The Rotation of North slider:
  94.         WIDGET_CONTROL, rotangle,GET_VALUE   = rot
  95.  
  96.         ;The size of the animation window:
  97.                 WIDGET_CONTROL, width, GET_VALUE     = wide
  98.                 WIDGET_CONTROL, height, GET_VALUE    = high
  99.         
  100.         ;The number of frames to be generated:
  101.                 WIDGET_CONTROL, numframes, GET_VALUE = nframes
  102.  
  103.         ;The Latitude and Longitude sampling parameters:
  104.         lts = 30 < imsize[1]
  105.         lns = 30 < imsize[0]
  106.         
  107.         ;These numbers get returned as arrays. Turn them into scalars:
  108.         nframes = nframes[0]
  109.         high = high[0]
  110.         wide = wide[0]
  111.         lon1=lon1[0]
  112.         lon2=lon2[0]
  113.         lat1=lat1[0]
  114.         lat2=lat2[0]
  115.         vlat=vlat[0]
  116.         rot=rot[0]
  117.  
  118.  
  119.         ;Make the Worldrot Widget insensitive.
  120.         WIDGET_CONTROL, base, SENSITIVE=0
  121.  
  122.         ;Convert THEPROJ to correct argument to proj keyword.
  123.         ;CONVECT maps the projection menu into correct proj keyvalue:
  124.         convect = [15,  6, 8, 5, 4, 9, 10, 2, 14, 1]
  125.         p = convect[theproj]
  126.  
  127.         ;Make the title for XinterAnimate window:
  128.         title = 'Rotating ' + names[theproj] + ' Projection'
  129.  
  130.         ;Make Animation Frames:
  131.             XINTERANIMATE, SET = [wide, high, nframes], $
  132.                      TITLE=title, GROUP = event.top, $
  133.                      /SHOWLOAD
  134.     
  135.             FOR i=0,nframes-1 DO BEGIN
  136.           ;Make the 'Frame n of x created.' message:
  137.                   mess =     'Frame '+ STRING(i+1, format='(I0)') + $
  138.             ' of ' + STRING(nframes, FORMAT='(I0)')+' created.'
  139.  
  140.            ;Set up the map projection:
  141.            step = i * 360. / nframes
  142.            MAP_SET, vlat, step, rot, PROJ=p
  143.  
  144.             ;Warp the image and show it
  145.            Tv, MAP_IMAGE(im, startx, starty, /WHOLE, $
  146.             BILINEAR = bilin), startx, starty
  147.            xyouts, 0, 0, /device, strtrim(fix(step),2), siz=1.5
  148.  
  149.             ;Draw the continents and gridlines:
  150.            IF (grid EQ 1) THEN BEGIN
  151.             DEVICE, SET_GRAPHICS_FUNCTION=6 ;XOR
  152.             MAP_GRID, COLOR = !d.n_colors-1, $
  153.                     latdel=15, londel = 15
  154.             DEVICE, SET_GRAPHICS_FUNCTION=3 ;NORMAL
  155.             ENDIF
  156.  
  157.            IF con EQ 1 THEN MAP_CONTINENTS, COLOR = 255
  158.  
  159.             ;Put the message in the message window:
  160.            WIDGET_CONTROL, message, SET_VALUE = mess
  161.  
  162.             ;Put the new frame into the Xinteranimate tool:
  163.                    XINTERANIMATE, FRAME = i, WINDOW = !D.WINDOW
  164.             ENDFOR
  165.  
  166.             
  167.         ;Call the Animation Tool & display new message
  168.         WIDGET_CONTROL, message, $
  169.             SET_VALUE=['Displaying Animation Tool']
  170.         XINTERANIMATE, 20, GROUP = event.top 
  171.         
  172.         ;Resensitize the Worldrot Widget
  173.  
  174.         WIDGET_CONTROL, base, /SENSITIVE
  175.         WIDGET_CONTROL, message, SET_VALUE = adjust
  176.         
  177.         END ;Create case
  178.  
  179.     "DRAWGRID": grid = 1    ;Turn grid drawing ON.
  180.       "NOGRID": grid = 0    ;Turn grid drawing OFF.
  181.  
  182.      "DRAWCON": con = 1        ;Turn continent drawing ON.
  183.        "NOCON": con = 0        ;Turn continent drawing OFF.
  184.  
  185.     "BILINEAR": bilin = 1    ;Turn bilinear interpolation ON.
  186.     "NOINTERP": bilin = 0    ;Turn bilinear interpolation OFF.
  187.  
  188.   "LOAD_ELEV": BEGIN
  189.         world_demo_color
  190.         openr, unit, /GET_LUN, FILEPATH('worldelv.dat', $
  191.                        sub=['examples','data'])
  192.         im = bytarr(360,360, /NOZERO)
  193.         readu, unit, im
  194.         free_lun, unit
  195.         im = shift(im, 180, 0)        ;Align -180 w/ left edge.
  196.         imsize = [360, 360]
  197.         ENDCASE
  198.     "HELP": BEGIN 
  199.         ;If HELP is pressed, display the help file.
  200.         XDISPLAYFILE, FILEPATH('wordemohelp.txt', $
  201.                    SUBDIR=['examples', 'misc', 'wexmast']), $
  202.             GROUP = event.top, TITLE = 'World Rotation Demo Help'
  203.         END ;Help case
  204.  
  205.     "FILE": BEGIN
  206.         ;If "Get a New Image" is pressed, use XGETDATA to retrieve the new image:
  207.         oldim = im
  208.         oldimsize = imsize
  209.         XGETDATA, im, /TWO_DIM, OFILENAME = fname, $
  210.             TITLE='Select an Image to Warp to the Map', $
  211.             GROUP = event.top, DIMENSIONS = imsize
  212.     ;If the "Cancel" button on XGETDATA is pressed, keep the old image:
  213.         s = SIZE(im)
  214.         IF s[0] EQ 0 THEN BEGIN
  215.             im = oldim
  216.             imsize = oldimsize
  217.         ENDIF ELSE BEGIN
  218.           if fname eq 'worldrot.dat' then im = shift(im, 180 ,0)
  219.         ENDELSE
  220.     ENDCASE
  221.  
  222.     "DONE": BEGIN
  223.         WIDGET_CONTROL, event.top, /DESTROY    ;If 'Done' is pressed,
  224.                             ;destroy all widgets
  225.                             ;and return to IDL.
  226.         im = 0            ;Free some memory
  227.         ENDCASE
  228.       ELSE: donothing=0    ;If nothing is pressed, don't do anything.
  229.  
  230.     ENDCASE
  231.  
  232. END
  233.  
  234.  
  235.  
  236. ; !!! MAKE THE ACTUAL WIDGETS !!!
  237.  
  238. PRO worlddemo, GROUP = GROUP, im1
  239.  
  240.  
  241. ; COMMON BLOCK
  242. COMMON world_block,projection,minlon,maxlon,minlat,maxlat,viewlat,width,$
  243.                    height,numframes,cna,dne,theproj,base,names,help,$
  244.            rotangle,message,adjust,$
  245.            drawcon,nocon,drawgrid,nogrid,im, $
  246.            bilinear,nointerp,con,grid,bilin, imsize
  247.  
  248. ; Only one copy of WORLDROT can run at a time due to the COMMON block.
  249. ; Check for other copies and do nothing if WORLDROT is already running:
  250.  
  251. IF(XRegistered("worldrot") NE 0) THEN RETURN
  252.  
  253. base = WIDGET_BASE(TITLE='World Rotation Demo', /ROW) ;MAIN WIDGET BASE
  254.  
  255. if n_elements(im1) lt 10 then begin
  256.     XGETDATA, im, /TWO_DIM, DIMENSIONS = imsize, OFILENAME = fname, $
  257.         TITLE='Select an Image to Warp to the Map', GROUP = base
  258. ENDIF ELSE BEGIN
  259.     im = im1        ;Copy to common
  260.     fname = 'xx'
  261.     imsize = size(im)
  262.     if imsize[0] ne 2 then message,'WORLDDEMO: parameter not image'
  263.     imsize = imsize[1:2]
  264. ENDELSE
  265.  
  266. ; If XGETDATA's cancel button was hit, don't continue.  Otherwise, do it to it:
  267. s = SIZE(im)
  268. IF s[0] GT 0 THEN BEGIN
  269.   if fname eq 'worldelv.dat' then im = shift(im, 180, 0)  ;Warp -180 to left
  270.  
  271. ;WORLD ROTATION TOOL HAS 3 MAIN COLUMNS
  272. lcol = WIDGET_BASE(base, /FRAME, /COLUMN)    ;Left column.
  273. mcol = WIDGET_BASE(base, /FRAME, /COLUMN)    ;Middle column.
  274.  
  275.  
  276. ;LEFT COLUMN IS THE EXCLUSIVE MENU OF PROJECTION TYPES, BUTTONS, AND OPTIONS
  277. lpad = WIDGET_BASE(lcol, /FRAME, /ROW)
  278.  
  279. ;The SPIN IT button:
  280.  
  281. spin =     [                $
  282.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B], $
  283.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B], $
  284.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B], $
  285.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B], $
  286.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B], $
  287.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B], $
  288.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B], $
  289.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B], $
  290.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 048B, 000B, 000B], $
  291.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 240B, 000B, 000B], $
  292.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 240B, 003B, 000B], $
  293.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 015B, 000B], $
  294.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 063B, 000B], $
  295.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 255B, 000B], $
  296.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 255B, 003B], $
  297.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 255B, 015B], $
  298.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 255B, 031B], $
  299.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 255B, 063B], $
  300.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 255B, 063B], $
  301.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 255B, 015B], $
  302.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 255B, 003B], $
  303.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 255B, 000B], $
  304.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 063B, 000B], $
  305.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 031B, 000B], $
  306.     [153B, 057B, 207B, 231B, 231B, 207B, 127B, 254B, 007B, 000B], $
  307.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 240B, 001B, 000B], $
  308.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 112B, 000B, 000B], $
  309.     [252B, 249B, 099B, 134B, 129B, 249B, 007B, 048B, 000B, 000B], $
  310.     [252B, 249B, 103B, 142B, 129B, 249B, 007B, 000B, 000B, 000B], $
  311.     [006B, 024B, 102B, 142B, 129B, 193B, 000B, 000B, 000B, 000B], $
  312.     [006B, 024B, 102B, 158B, 129B, 193B, 000B, 000B, 000B, 000B], $
  313.     [006B, 024B, 102B, 150B, 129B, 193B, 000B, 000B, 000B, 000B], $
  314.     [124B, 248B, 099B, 182B, 129B, 193B, 000B, 000B, 000B, 000B], $
  315.     [248B, 248B, 099B, 166B, 129B, 193B, 000B, 000B, 000B, 000B], $
  316.     [128B, 025B, 096B, 230B, 129B, 193B, 000B, 000B, 000B, 000B], $
  317.     [128B, 025B, 096B, 198B, 129B, 193B, 000B, 000B, 000B, 000B], $
  318.     [128B, 025B, 096B, 198B, 129B, 193B, 000B, 000B, 000B, 000B], $
  319.     [254B, 024B, 096B, 134B, 129B, 193B, 000B, 000B, 000B, 000B], $
  320.     [254B, 024B, 096B, 134B, 129B, 193B, 000B, 000B, 000B, 000B], $
  321.     [000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B, 000B] $
  322.     ]
  323.  
  324.  
  325.  
  326. dne = WIDGET_BUTTON(lpad, VALUE = 'Done', UVALUE = 'DONE')
  327.  
  328. ; Make the cool bitmap SPIN IT button if Motif, if Open Look, don't bother:
  329.  
  330. VERSION    = WIDGET_INFO(/VERSION)
  331. IF (VERSION.STYLE EQ 'OPEN LOOK') THEN $
  332. cna = WIDGET_BUTTON(lpad, VALUE = 'Spin World', UVALUE = 'CREATE') $
  333. ELSE $
  334. cna = WIDGET_BUTTON(lpad, VALUE = spin, UVALUE = 'CREATE')
  335. ;file = WIDGET_BUTTON(lpad, VALUE = 'Get a New Image', UVALUE = 'FILE')
  336. help = WIDGET_BUTTON(lpad, VALUE = 'Help', UVALUE = 'HELP')
  337.  
  338.  
  339. ;The text for the exclusive projection buttons:
  340. names = ['Aitoff', 'Azimuthal Equidistant', 'Cylindrical', 'Gnomonic', $
  341.     'Lambert''s Equal Area', $
  342.         'Mercator', 'Mollweide', 'Orthographic', 'Sinusoidal', $
  343.         'Stereographic']
  344.  
  345. ;Make the exclusive projection list. Turn release events off:
  346. title = WIDGET_BASE(lcol, /FRAME, /COLUMN)
  347. label = WIDGET_LABEL(title, VALUE='Map Projection')
  348. first_menu_id = CW_BGROUP(title, names, /EXCLUSIVE, /NO_RELEASE, $
  349.                           IDS = projection, UVALUE = 'THEMENU', $
  350.                           /COLUMN, /FRAME, /RETURN_ID)
  351.  
  352. drawlabel = WIDGET_LABEL(lcol, VALUE = 'Drawing Options:')
  353.  
  354. ;This is the two-button 'toggle' switch for continent drawing:
  355. conbase = WIDGET_BASE(lcol, /ROW, /FRAME, /EXCLUSIVE)
  356. drawcon = WIDGET_BUTTON(conbase, VALUE='Draw Continents', UVALUE='DRAWCON',$
  357.             /NO_RELEASE)
  358. nocon = WIDGET_BUTTON(conbase, VALUE='No Continents', UVALUE='NOCON',$
  359.               /NO_RELEASE)
  360.  
  361. ;This is the two-button 'toggle' switch for grid drawing:
  362. gridbase = WIDGET_BASE(lcol, /ROW, /FRAME, /EXCLUSIVE)
  363. drawgrid = WIDGET_BUTTON(gridbase, VALUE='Draw Grid', UVALUE='DRAWGRID',$
  364.              /NO_RELEASE)
  365. nogrid = WIDGET_BUTTON(gridbase, VALUE='No Grid', UVALUE='NOGRID',$
  366.                /NO_RELEASE)
  367.  
  368. ;This is the two-button 'toggle' switch for bilinear interpolation:
  369. bilinbase = WIDGET_BASE(lcol, /ROW, /FRAME, /EXCLUSIVE)
  370. bilinear = WIDGET_BUTTON(bilinbase, VALUE='Bilinear Interpolation', $
  371.              UVALUE='BILINEAR', /NO_RELEASE)
  372. nointerp = WIDGET_BUTTON(bilinbase, VALUE='No Interpolation', $
  373.              UVALUE='NOINTERP', /NO_RELEASE)
  374.  
  375. junk = WIDGET_BUTTON(lcol, VALUE='Load Elevation Data', /NO_REL, $
  376.     UVALUE="LOAD_ELEV")
  377.  
  378. ;MIDDLE COLUMN HAS LOTS OF STUFF
  379.  
  380. viewlabel = WIDGET_LABEL(mcol, VALUE = 'Viewing Options:')
  381.  
  382. mcol2 = WIDGET_BASE(mcol, /FRAME, /COLUMN)
  383.  
  384. viewlat = WIDGET_SLIDER(mcol2, TITLE = 'Latitude to be Centered', $
  385.                         MINIMUM = -90, MAXIMUM = 90, VALUE = 0, $
  386.             UVALUE = 'latslider')
  387.  
  388. ;The 'Rotation of North' slider:
  389. rotangle = WIDGET_SLIDER(mcol2, TITLE = 'Rotation of North', $
  390.              MINIMUM = -180, MAXIMUM = 180, VALUE = 0, $
  391.              UVALUE = 'rotslider', XSIZE = 255)
  392.  
  393.  
  394.  
  395. ;RIGHT COLUMN HAS SLIDER AND BUTTONS
  396.  
  397. ;The 'Animation Window Size' fields:
  398. winbase =  WIDGET_BASE(mcol, /COLUMN, /FRAME)
  399. wintitle = WIDGET_LABEL(winbase, VALUE='Animation Window Size:')
  400. w5 = WIDGET_BASE(winbase, /ROW)
  401.  
  402. w15 = WIDGET_LABEL(w5, VALUE = 'Width')
  403. width = WIDGET_TEXT(w5, XSIZE=3, YSIZE=1, /EDITABLE, VALUE='400', $
  404.                     UVALUE = 'setwidth')
  405.  
  406. w35 = WIDGET_LABEL(w5, VALUE = 'Height')
  407. height = WIDGET_TEXT(w5, XSIZE=3, YSIZE=1, /EDITABLE, VALUE='400', $
  408.                      UVALUE = 'setheight')
  409.  
  410. ;The 'Number of Frames' slider:
  411. numframes = WIDGET_SLIDER(mcol, TITLE = 'Number of Frames', $
  412.                           MAXIMUM=36, MINIMUM=2,VALUE=16, /FRAME, $
  413.                UVALUE = 'frameslider')
  414.  
  415. ;The 'Messages' window:
  416. instruct = WIDGET_LABEL(mcol, VALUE='Messages:')
  417. message = WIDGET_TEXT(mcol, XSIZE=28, YSIZE=2, UVALUE='createtext', FRAME=2)
  418.  
  419. ;Create some default messages:
  420. adjust=['Adjust parameters and/or','select the SPIN button.']
  421.  
  422. ;REALIZE THE WIDGETS:
  423. WIDGET_CONTROL, base, /REALIZE
  424.  
  425. ;Set the default to be ORTHOGRAPHIC
  426. theproj = 6
  427. WIDGET_CONTROL, projection[theproj], /SET_BUTTON
  428.  
  429. ;Put the 'Adjust values...' message in the message window:
  430. WIDGET_CONTROL, message, SET_VALUE = adjust
  431.  
  432. ;Set Grid drawing to ON:
  433. WIDGET_CONTROL, drawgrid, /SET_BUTTON
  434. grid = 1
  435.  
  436. ;Set Continent drawing to ON:
  437. WIDGET_CONTROL, drawcon, /SET_BUTTON
  438. con = 1
  439.  
  440. ;Set Interpolation to OFF:
  441. WIDGET_CONTROL, nointerp, /SET_BUTTON
  442. bilin = 0
  443.  
  444. ;HAND THINGS OFF TO THE X MANAGER:
  445. XMANAGER, 'worlddemo', base, GROUP_LEADER = GROUP, /NO_BLOCK
  446.  
  447. ENDIF ELSE BEGIN
  448.     WIDGET_CONTROL, base, /DESTROY
  449. ENDELSE
  450.  
  451. END
  452.